<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>12-分组别名</title>
	<style type="text/css">
	* {
		padding: 0;
		margin: 0;
	}
	span.red{
		color: red;
	}
    </style>
</head>
<body>
	<div class="container" id="container">
		<h1>12-分组别名</h1> 
	  <p>后盾人</p>
	  <h1>houdunren.com</h1>
	  <h1>hdcms.com</h1>
	</div>
	<script src="../tools/utils.js"></script>
	<script type="text/javascript">
		
 var  hd = `
  <h1>houdunren</h1>
  <span>后盾人</span>
  <h2>hdcms</h2>
`;
let reg = /<(?<tag>h[1-6])>(?<con>[\s\S]*)<\/\1>/gi;
console.log(hd.replace(reg, `<p>$<con></p>`));
console.log(hd.replace(reg, `<p>$2</p>`));


	</script>
</body>
</html>